Skip to content

Another tailcall vm_interrupt bug#22265

Open
morrisonlevi wants to merge 5 commits into
php:PHP-8.5from
morrisonlevi:tailcall-vm-interrupt-round2
Open

Another tailcall vm_interrupt bug#22265
morrisonlevi wants to merge 5 commits into
php:PHP-8.5from
morrisonlevi:tailcall-vm-interrupt-round2

Conversation

@morrisonlevi

@morrisonlevi morrisonlevi commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

We fixed a bug in the tailcall VM related to vm_interrupt in 8.5.7: #21922. Unfortunately I was able to find another crash, reproducer attached.

Note that the "return opline" variant that Arnaud benchmarked passes this test. This PR instead adds a SAVE_OPLINE before ZEND_VM_LOOP_INTERRUPT in a specific macro. They seemed very close in speed, and @bwoebi preferred this to partially reverting.

@iluuu1994 iluuu1994 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't spent too much time with the tailcall VM but the fix looks correct to me.

Comment thread Zend/zend_execute.c

#define ZEND_VM_LOOP_INTERRUPT_CHECK() do { \
if (UNEXPECTED(zend_atomic_bool_load_ex(&EG(vm_interrupt)))) { \
SAVE_OPLINE(); \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this probably only used in the HYBRID_DEFAULT branch. Though probably rather harmless in the other case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants